var str = 'A';
var space = ' ';
var weight = 15;
var height = 0;
let result;

if (weight % 2 == 1) {
  height = (weight + 1) / 2;
}
else {
  height = weight / 2.
}

for (var i = 0; i < height; i++)
{
  result  = '';
  for (var j = 1; j <= weight; j++)
  {
    if (j == height - i || j == height + i || i == height - 1)
    {
      result += str;
    }
    else
    {
      result += space;
    }
  }
  console.log(result);
}
